home *** CD-ROM | disk | FTP | other *** search
- Path: tank.news.pipex.net!pipex!warwick!leicester!usenet
- From: "J. Springthorpe" <juy@le.ac.uk>
- Newsgroups: comp.lang.c++
- Subject: FILES & cin.* help needed please...
- Date: 21 Mar 1996 08:02:11 GMT
- Organization: University of Leicester, UK
- Message-ID: <4ir2e3$r7i@falcon.le.ac.uk>
- NNTP-Posting-Host: hawk.le.ac.uk
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1S (X11; I; IRIX 5.3 IP19)
- X-URL: news:comp.lang.c++
-
- help would be very much appreciated. My c++ source code works fine using
- borland c++ turbo.
-
- the source code compiles fine using watcom c++, however, my program crashes out
- when it comes across this line (while running);
-
- Member m; // class
- membersFile.open("members.dat", ios::in | ios::binary);
- membersFile.read((char *) &m, sizeof(m)); // DOES NOT LIKE THIS LINE
-
-
- when trying to compile source code on an sgi machine using CC, I get these
- complile errors;
-
- members.cpp:
- "member.h", line 8: error(3337): invalid redeclaration of type name "Member"
- class Member
- ^
-
- "members.cpp", line 30: error(3225): class "ios" has no member "binary"
- membersFile.open("members.dat", ios::app | ios::binary); // ios::app -
- append mode
-
- If any one is a die hard c++ whiz, I'd be happy to send you my source code
- (only a small program) for more details. Thanks v. much for any help.
-
-
-
- 2) also, could some one give me some vibes on how cin.get, cin.ignore,
- cin.getline etc are suppose to work. I have probs trying to input a string
- (with white space) into a variable e.g. "something like";
-
- cin.get(name, 80);
- cin.ignore(80, '\n'); // when ran, the program skips these lines...
-
- cin.get(address, 90); // is it possible to use [BUFSIZ]?
- cin.ignore(90, '\n');
-
- *******************************************************************************
- * Stunt Bat Juy - Most Dramatic Grade V Probe Run *
- * http://www.le.ac.uk/CWIS/SU/SO/CASOC/juy.html *
- *******************************************************************************
-
-